//
//  main.m
//  TMSDriver
//
//  Created by admin on 2018/3/6.
//  Copyright © 2018年 zhuchongjin All rights reserved.
//

#import <UIKit/UIKit.h>
#import "AppDelegate.h"

/***************************阻止动态调试****************************/
 
#import <dlfcn.h>
 
#import <sys/types.h>
 
typedef int (*ptrace_ptr_t)(int _request,pid_t _pid,caddr_t _addr,int _data);
 
#if !defined(PT_DENY_ATTACH)
 
#define PT_DENY_ATTACH 31
 
#endif
 
 
 
void disable_gdb(){
 
    void* handle = dlopen(0, RTLD_GLOBAL|RTLD_NOW);
 
    ptrace_ptr_t ptrace_ptr = dlsym(handle, "ptrace");
 
    ptrace_ptr(PT_DENY_ATTACH,0,0,0);
 
    dlclose(handle);
 
}
 
/******************************************************************/


int main(int argc, char * argv[]) {
    

    #if !(DEBUG)
     
      disable_gdb();
     
     
     
    #endif
     
    NSString * appDelegateClassName;
    @autoreleasepool {
        // Setup code that might create autoreleased objects goes here.
        appDelegateClassName = NSStringFromClass([AppDelegate class]);
        
    }
    return UIApplicationMain(argc, argv, nil, appDelegateClassName);
}
